program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, a, i, x: integer;
  mass: array of integer;
begin
  x:=0;
  readln(n);
  setlength(mass, n);
  for i:=0 to n-1 do
    read(mass[i]);
  for i:=0 to n-1 do
  begin
    if (i mod 2 = 0 ) then
    begin
      if (mass[i]=2) then
        x:=x+1;
    end else begin
      if (mass[i]=1) then
        x:=x+1;
    end;
  end;
  writeln(x);
  readln;
  readln;
end.
